package main

import (
	"flag"
	"fmt"
)

// go语言解析命令行参数
var b = flag.Bool("b",false,"bool类型参数")
var s = flag.String("s","","string类型参数")
var t = flag.Int("t",0,"int类型参数")

// -b -s hello -t 10 the other args 编译完之后在命令行运行时可以的
func main() {
  argsParse()
}


func argsParse(){
  flag.Parse()
  fmt.Println("-b:",*b)
  fmt.Println("-s:",*s)
  fmt.Println("-t:",*t)
  fmt.Println("其它参数的解析：",flag.Args())
}